#!/usr/bin/env bash

set -e
curr_resp='feature/shsyang'
arr=('develop' 'test' 'uat')

if [ -n "$1" ];then
  curr_resp=$1
fi

merge_resp=$curr_resp

for resp in ${arr[@]};do
git switch $resp
git pull
git merge --no-ff  $merge_resp
git push
merge_resp=$resp
done

git switch $curr_resp
git merge develop
git push

exec /bin/bash